package goover.unit01;

import java.util.Objects;
public class Person01 {
    private  int id;
    private String name;
    private String sex;
    public Person01(int id, String name, String sex) {
        this.id = id;
        this.name = name;
        this.sex = sex;
    }
    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (!(o instanceof Person01)) return false;
        Person01 person01 = (Person01) o;
        return id == person01.id &&
                Objects.equals(name, person01.name) &&
                Objects.equals(sex, person01.sex);

    }
    @Override
    public String toString() {
        return "Person01{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", sex='" + sex + '\'' +
                '}';
    }
}
